<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="alert alert-danger-light">
        <b>温馨提示</b><br>
        建筑地址信息中填写的了经纬度，则不会根据省市区街道及详细地址解析经纬度<br>
        建筑地址信息中未填写经纬度，则会根据省市区街道及详细地址解析经纬度
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('建筑名称')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" class="form-control" name="row[name]" type="text" value="" data-rule="required">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">省市区街道:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="form-inline" data-toggle="cxselect" data-selects="prov,city,region,street">
                <select class="prov form-control" data-rule="required" name="prov" data-url="xiluhouse/ajax/area">
                </select>
                <select class="city form-control" data-rule="required" name="city" data-url="xiluhouse/ajax/area">
                </select>
                <select class="region form-control" data-rule="required" name="region" data-url="xiluhouse/ajax/area">
                </select>
                <select class="street form-control" data-rule="required" name="street" data-url="xiluhouse/ajax/area">
                </select>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('详细地址')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-address" data-rule="required" class="form-control" name="row[address]" type="text">
        </div>
    </div>

    <div style="color: #18bc9c;" data-toggle="addresspicker" data-lat-id="c-lat" data-lng-id="c-lng">
        点击这里打开地图选择经纬度（如果不填写经纬度，则会自动根据填写的地址生成经纬度）</div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('经纬度')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="row">
                <div class="col-xs-6">
                    <input id="c-lat" class="form-control" name="row[lat]" type="text" value="" placeholder="纬度">
                </div>
                <div class="col-xs-6">
                    <input id="c-lng" class="form-control" name="row[lng]" type="text" value="" placeholder="经度">
                </div>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('关联公司')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-companies" class="form-control selectpage" name="row[company_ids]" type="text" value=""
                    data-source="company/index" data-multiple="true" data-field="name" data-primary-key="id">
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('状态')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')])}
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>